
<?php

class login{
	public $arr_usu= array("mike");
	public $arr_pass= array("cisco");
	public $usu_s;
	public $pass_s;
	
	public function setValores(){
		$this->usu_s=$_GET['usuario'];
		$this->pass_s=$_GET['password'];		
	}
	
	public function validarLogin(){
		if(($this->arr_usu[0]==$this->usu_s) and ($this->arr_pass[0]==$this->pass_s))
			//header("location:../pag_principal.php");
			return true;
		else
			//header("location:../index.php");
			return false;
	}
}


//instancia de la clase
$instancia = new login;
$instancia->setValores();

$estado = $instancia->validarLogin();
if ($estado){
	
	session_start();
	
	$_SESSION['usr']= $instancia->usu_s;
	$_SESSION['nombre']= "Michael Mendoza";
	$_SESSION['perf']= "Administrador";
	
	header("location:../pag_principal.php");
}
else
	header("location:../index.php");



?>